home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1993 December / PSL Monthly Shareware CD-ROM (December 1993).iso / prgmming / dos / c / dblmon.exe / TESTDUAL.C < prev    next >
C/C++ Source or Header  |  1992-06-15  |  2KB  |  72 lines

  1.  
  2. /*
  3.  * Simple little test program for DUALMON.C
  4.  */
  5.  
  6. #include  <conio.h>
  7. #include  "dualmon.h"
  8.  
  9. void  main( void )
  10. {
  11.   /* Vars */
  12.   int   i;
  13.  
  14.   /* Clear both monitors */
  15.   clrscr();     /* EGAVGA */
  16.   ClearMono();  /* Mono */
  17.  
  18.   /* Loop and print backwards on each screen */
  19.   for( i = 24; i > 0; i-- )
  20.     {
  21.     gotoxy( 1, i );
  22.     cprintf( "I'm here at line %d", i );
  23.  
  24.     /*
  25.      * Try some different attributes
  26.      * 0x07 = normal  (indicated by passing 0 to PrintToMono())
  27.      * 0x01 = underline normal
  28.      * 0x70 = reverse video
  29.      * 0x0f = high intensity
  30.      * 0x81 = blink
  31.      * etc...
  32.      */
  33.     if( i > 20 )
  34.       PrintToMono( i, 1, 0, "And I'm here at line %d (normal)", i );
  35.     else if( i > 15 )
  36.       PrintToMono( i, 1, 0x01, "And I'm here at line %d (underline)", i );
  37.     else if( i > 11 )
  38.       PrintToMono( i, 1, 0x70, "And I'm here at line %d (reverse)", i );
  39.     else if( i > 8 )
  40.       PrintToMono( i, 1, 0x0f, "And I'm here at line %d (high intensity)", i );
  41.     else if( i > 4 )
  42.       PrintToMono( i, 1, 0x81, "And I'm here at line %d (blink)", i );
  43.     else
  44.       PrintToMono( i, 1, 0, "And I'm here at line %d (back to normal)", i );
  45.     }
  46.  
  47.   /* Wait for a keypress */
  48.   getch();
  49.  
  50.   /* Clear both monitors */
  51.   clrscr();     /* EGAVGA */
  52.   ClearMono();  /* Mono */
  53.  
  54.   /* Scrolling test */
  55.   gotoxy( 1, 24 );
  56.   for( i = 1; i < 50; i++ )
  57.     {
  58.     printf( "Writing line #: %d\n", i );
  59.     PrintToMono( 0, 0, 0, "Mono writing line #: %d", i );
  60.     }
  61.  
  62.   /* Wait for key */
  63.   printf( "Press any key..." );
  64.   PrintToMono( 0, 0, 0, "Press any key..." );
  65.   getch();
  66.  
  67.   /* Clear both monitors */
  68.   clrscr();     /* EGAVGA */
  69.   ClearMono();  /* Mono */
  70. }
  71.  
  72.